﻿
/*
NAILSUPERSTORE ® COMPANY
 
[HISTORY]
Created By  	: NGUYEN VAN TY
Created Date	: 12/07/2010
Modified By     :
Modified Date   :
Note            :

*/

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using CommonTagTime.DataAccess;
using CommonTagTime.ModelObject;
namespace CommonTagTime.Business
{
    public class busImageProduct
    {
        //------------------------------------------------
        //FIELD TABLE
        //------------------------------------------------
        public const string TABLE = "ImageProduct";
        public const string IMAGEPRODUCTID = "ImageProductID";
        public const string PRODUCTID = "ProductID";
        public const string DESCRIPTION= "Description";
        public const string FILENAME = "FileName";
        public const string CURRENTPAGE = "CurrentPage";
        public const string PAGESIZE = "PageSize";     
        public const string TOTALRECORDS = "TotalRecords";
        public const string CONDITION = "Condition";


        private daoImageProduct _daoImageProduct;
        //------------------------------------------------
        //PUBLIC
        //------------------------------------------------
        public busImageProduct()
        {
            _daoImageProduct = new daoImageProduct();
        }
        public bool Insert(ImageProduct objImageProduct)
        {
            return _daoImageProduct.Insert(objImageProduct);
        }
        public void Insert(ImageProductCollection lstImage)
        {
            
            foreach (ImageProduct objImageProduct in lstImage)
            {
                if (objImageProduct.ProductID >0) 
                _daoImageProduct.Insert(objImageProduct);
            }            
        }
        public ImageProductCollection GetListByProductID(int productID)
        {
            return _daoImageProduct.GetListByProductID(productID);
        }
        public bool Delete(int imageProductID)
        {
            return _daoImageProduct.Delete(imageProductID);
        }
        public bool DeleteByProductID(int ProductID)
        {
            return _daoImageProduct.DeleteByProductID(ProductID);
        }
    }

}